<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button id="btn">显示/隐藏</button>
    <div id="text">hello text</div>
    <script>
      const text = document.getElementById("text");
      const btn = document.getElementById("btn");

      btn.onclick = function () {
        text.hidden = !text.hidden;
      };

      // setTimeout(() => {
      // text.hidden = true;
      // text.style.display = "none";
      // }, 5000);
    </script>
  </body>
</html>
